package ControlLayer;
import ModelLayer.Country;
import DBLayer.DBCountry;
import java.util.ArrayList;

public class CtrCountry {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrCountry instance = null;
    DBCountry dbCountry = new DBCountry();

    public CtrCountry() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrCountry getInstance() {
        if (instance == null) {
            instance = new CtrCountry();
        }
        return instance;
    }

    public ArrayList<Country> getCountryList() {
        return dbCountry.getCountryList();
    }

    public Country getCountryByID(int id) {
        return dbCountry.getCountryByID(id);
    }

    public int addCountry(Country country) {
        return dbCountry.addCountry(country);
    }

    public int updateCountry(Country country, int id) {
        return dbCountry.updateCountry(country, id);
    }

    public void deleteCountry(int id) {
        dbCountry.deleteCountry(id);
    }
    // </editor-fold>
}
